<?php
$this->rmenu=array(
	array('label'=>'Clear search', 'url'=>array('list')),
);

$this->menu=array(
	array('label'=>'Create cargo', 'url'=>array('create')),
	array('label'=>'List cargo','url'=>array('list')),
);
?>

<h1>Cargo listing</h1>

<div class="row">
	<?php echo CHtml::activeLabelEx($model,'searchText'); ?>
	<?php echo CHtml::activeTextField($model,'searchText'); ?>
</div>

<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$model->search(),
	'itemView'=>'_view',
 	'id'=>'cargo_list',
)); ?>
<?php
$cs = Yii::app()->getClientScript();
$searchURL = CHtml::normalizeUrl(array('cargo/list'));

$script =<<<EOD
$('input#cargo_searchText').keypress(function(event){
	if(event.keyCode == '13'){
		$.fn.yiiListView.update('cargo_list',{url:'$searchURL',data:{searchText:$(this).val()}});
	}
});
EOD;
$cs->registerScript("packageScript",$script,CClientScript::POS_END);
?>